package com.lightdz.tshirtdz.dal.impl;

import com.lightdz.tshirtdz.model.Enum.BaseStatusEnum;
import com.lightdz.tshirtdz.model.entity.PayRecordEntity;

import com.lightdz.tshirtdz.utils.MybatisDBHelper;
import org.springframework.stereotype.Repository;

import java.sql.Timestamp;
import java.util.Date;

/**
 * @ Description：${description}
 * @ Author     ：zbl
 * @ Date       ：Created in 16:54 09/08/2018
 * @ Modified By：
 */
@Repository
public class PayRecordDal {

    /**
     * 添加到我的付款记录
     *
     * @return
     */
    public boolean addPayRecord(double money,int PayStatus,long pid,String RecordTransNum,String Remark,String wxId) {
        PayRecordEntity entity =new PayRecordEntity();
        entity.setCreatetime(new Timestamp(new Date().getTime()));
        entity.setMoney(money);
        entity.setPayStatus(PayStatus);
        entity.setPid(pid);
        entity.setRecordTransNum(RecordTransNum);
        entity.setRemark(Remark);
        entity.setStatus(BaseStatusEnum.Normal.getValue());
        entity.setUpdatetime(new Timestamp(new Date().getTime()));
        entity.setWxid(wxId);

        int result = MybatisDBHelper.Add("addPayRecord", entity);
        return result > 0;
    }
}
